import { lazyReportBatch } from "../report.js";
export default function click() {
    ['mousedown','touchstart'].forEach(eventType => {
        window.addEventListener(eventType,e => {
            const target = e.target;
            if(target.tagName) {
                const reportData = {
                    // screenTop:document.documentElement.scrollTop,
                    type:'behavior',
                    subType:'click',
                    target:target.tagName,
                    startTime:e.timeStamp,
                    innerHtml:target.innerHTML,
                    outerHtml:target.outerHTML,
                    width:target.offsetWidth,
                    height:target.offsetHeight,
                    eventType,
                    path:e.path
                }
                console.log('behavior click',eventType,e,reportData);
                lazyReportBatch(reportData);
            }
        })
    }) 
}